capitalize first letter in python

34

s = "python"
print("Original string:")
print(s)
print("After capitalizing first letter:")
print(s.capitalize())
my_string = "programiz is Lit"

cap_string = my_string.capitalize()

print(cap_string)
my_string = "programiz is Lit"

print(my_string[0].upper() + my_string[1:])

Comments

Submit
0 Comments